package com.atguigu.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * å•†å“ä¸‰çº§åˆ†ç±»
 *
 * @author hww
 * @email 2226565664@qq.com
 * @date 2020-06-22 17:35:07
 */
@Data
@TableName("pms_category")
public class CategoryEntity implements Serializable {
  private static final long serialVersionUID = 1L;

  /** åˆ†ç±»id */
  @TableId private Long catId;
  /** åˆ†ç±»åç§° */
  private String name;
  /** çˆ¶åˆ†ç±»id */
  private Long parentCid;
  /** å±‚çº§ */
  private Integer catLevel;
  /** æ˜¯å¦æ˜¾ç¤º[0-ä¸æ˜¾ç¤ºï¼Œ1æ˜¾ç¤º] */
  //@TableLogic 注解代表这是一个逻辑删除字段 1删除，0不删除
  @TableLogic(value = "1",delval = "0")
  private Integer showStatus;
  /** æŽ’åº */
  private Integer sort;
  /** å›¾æ ‡åœ°å€ */
  private String icon;
  /** è®¡é‡å•ä½ */
  private String productUnit;
  /** å•†å“æ•°é‡ */
  private Integer productCount;

  public CategoryEntity(
      Long catId,
      String name,
      Long parentCid,
      Integer catLevel,
      Integer showStatus,
      Integer sort,
      String icon,
      String productUnit,
      Integer productCount,
      List<CategoryEntity> children) {
    this.catId = catId;
    this.name = name;
    this.parentCid = parentCid;
    this.catLevel = catLevel;
    this.showStatus = showStatus;
    this.sort = sort;
    this.icon = icon;
    this.productUnit = productUnit;
    this.productCount = productCount;
    this.children = children;
  }

  public List<CategoryEntity> getChildren() {
    return children;
  }

  public void setChildren(List<CategoryEntity> children) {
    this.children = children;
  }

  @TableField(exist = false) // 此注解表示是自己的添加非数据库字段
  private List<CategoryEntity> children;//子类别

  public CategoryEntity() {
    super();
  }

  public CategoryEntity(
      Long catId,
      String name,
      Long parentCid,
      Integer catLevel,
      Integer showStatus,
      Integer sort,
      String icon,
      String productUnit,
      Integer productCount) {
    this.catId = catId;
    this.name = name;
    this.parentCid = parentCid;
    this.catLevel = catLevel;
    this.showStatus = showStatus;
    this.sort = sort;
    this.icon = icon;
    this.productUnit = productUnit;
    this.productCount = productCount;
  }

  public static long getSerialVersionUID() {
    return serialVersionUID;
  }

  public Long getCatId() {
    return catId;
  }

  public void setCatId(Long catId) {
    this.catId = catId;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public Long getParentCid() {
    return parentCid;
  }

  public void setParentCid(Long parentCid) {
    this.parentCid = parentCid;
  }

  public Integer getCatLevel() {
    return catLevel;
  }

  public void setCatLevel(Integer catLevel) {
    this.catLevel = catLevel;
  }

  public Integer getShowStatus() {
    return showStatus;
  }

  public void setShowStatus(Integer showStatus) {
    this.showStatus = showStatus;
  }

  public Integer getSort() {
    return sort;
  }

  public void setSort(Integer sort) {
    this.sort = sort;
  }

  public String getIcon() {
    return icon;
  }

  public void setIcon(String icon) {
    this.icon = icon;
  }

  public String getProductUnit() {
    return productUnit;
  }

  public void setProductUnit(String productUnit) {
    this.productUnit = productUnit;
  }

  public Integer getProductCount() {
    return productCount;
  }

  public void setProductCount(Integer productCount) {
    this.productCount = productCount;
  }
}
